//
//  AdMoreRewardVideoAd.h
//  AdMoreSDKDemo
//
//  Created by Hayder on 2023/5/8.
//  视频激励广告

#import "AdMoreBaseAd.h"

NS_ASSUME_NONNULL_BEGIN
@interface AdMoreRewardInfo : NSObject

/// 是否达到激励条件
@property (nonatomic,assign) BOOL isCompelted;

/// 交易的唯一id
@property (nonatomic, copy) NSString *transId;

/// 用户id
@property (nonatomic, copy) NSString *userId;

@end


@class AdMoreRewardVideoAd;
@protocol AdMoreRewardVideoAdDelegate <NSObject>

@optional
/**激励视频加载成功回调*/
- (void)rewardedVideoAdDidLoad:(AdMoreRewardVideoAd *)rewardedVideoAd slotId:(NSString *)slotId;
/**激励视频预加载成功回调*/
- (void)rewardedVideoAdPreLoadSuccess:(AdMoreRewardVideoAd *)rewardedVideoAd;

/**激励视频加载失败回调*/
- (void)rewardedVideoAd:(AdMoreRewardVideoAd *)rewardedVideoAd didFailWithError:(NSError *_Nullable)error;

/**激励视频开始播放回调 =展示成功*/
- (void)rewardedVideoAdPlayStart:(AdMoreRewardVideoAd *)rewardedVideoAd;
/**激励视频播放结束回调*/
- (void)rewardedVideoAdPlayEnd:(AdMoreRewardVideoAd *)rewardedVideoAd;
/**激励视频播放出错*/
- (void)rewardedVideoAdPlayError:(AdMoreRewardVideoAd *)rewardedVideoAd error:(NSError *)error;


/**激励视频点击回调*/
- (void)rewardedVideoAdDidClick:(AdMoreRewardVideoAd *)rewardedVideoAd;
/**激励视频关闭回调*/
- (void)rewardedVideoAdDidClose:(AdMoreRewardVideoAd *)rewardedVideoAd;
/**激励视频跳过回调,不实现则跳过广告*/
- (void)rewardedVideoAdDidSkip:(AdMoreRewardVideoAd *)rewardedVideoAd;

/**奖励验证回调*/
- (void)rewardedVideoAdServerRewardDidSucceed:(AdMoreRewardVideoAd *)rewardedVideoAd rewardInfo:(AdMoreRewardInfo *)rewardInfo;

@end



@interface AdMoreRewardVideoAd : AdMoreBaseAd

@property (nonatomic, strong, readonly) NSString *slotID;

@property (nonatomic, weak) id<AdMoreRewardVideoAdDelegate> delegate;

/**
 slotID: 广告位ID
 */
- (instancetype)initWithSlotID:(NSString *)slotID;

/**
 slotID: 广告位ID
 userId: 用户id
 options: 自定义参数
 */
- (instancetype)initWithSlotID:(NSString *)slotID userId:(NSString *)userId Options:(NSDictionary *)options;
/**
 重新设置请求自定义参数
 */
- (void)resetRequestOptions:(NSDictionary<NSString *, NSString *> *)options;

- (void)loadAdData;

- (void)showFromRootViewController:(UIViewController *)showController;

@end

NS_ASSUME_NONNULL_END
